<?php

namespace App\Http\Requests;

use Illuminate\Validation\Rule;

class BindPhoneRequest extends Request
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'phone' => 'required|phone:CN,mobile|unique:wx_members',
        ];
    }

    public function messages()
    {
        return [
            'phone.required' => '手机号不能为空',
            'phone.phone' => '手机号格式不正确',
            'phone.unique' => '该手机号已经绑定'
        ];
    }
}
